<?php

namespace app\index\controller;
use think\App;
use think\Request;
use app\index\model\Store;
use app\index\model\Manager;
use app\index\model\Order;
use app\index\model\Allocation;
/**
 * Class Index
 * @package app\index\controller
 */
class Index extends Common
{

    public function __construct(App $app = null, Request $request)
    {
        parent::__construct($app, $request);
    }

    /**
     * @return  首页
     */
    public function index(){
        // $uid=Session::get("u_id");
        // $sid=Session::get("shop_id");
        $uid=13;
        $sid=2;
        $user=Manager::getone(array('id' => $uid));
        $store=Store::getone(array('id' => $sid));
        $data['username']=$user['username'];
        $data['shopname']=$store['title'];
        $data['num']=$store['cknum'];
        $data['a_count']=Allocation::getcount(array('outsid' => $sid,'status' => 1));
        $where = array('sid' => $sid,'status' => 1);
        $today = strtotime(date("Y-m-d"),time());
        $end = $today+60*60*24;
        $data['o_count']=Order::getcount($where,$today,$end);
        $this->return = $data;
    }
}